package com.qiyuexinxi.chat.dto.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author yangxingyu
 * @date 2020/2/25
 * @description
 */
@ApiModel("完善信息请求")
@Data
public class CompleteInfoRequest {

    @ApiModelProperty(value = "用户id",required = true)
    @NotNull(message = "用户id不能为空")
    private Integer userId;

    @ApiModelProperty(value = "用户昵称",required = true)
    @NotEmpty(message = "用户名称不能为空")
    private String username;

    @ApiModelProperty("用户生日 格式YYYY-MM-DD")
    @NotEmpty(message = "用户生日不能为空")
    @Pattern(regexp = "^((((1[6-9]|[2-9]\\d)\\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\\d|3[01]))|(((1[6-9]|[2-9]\\d)\\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\\d|30))|(((1[6-9]|[2-9]\\d)\\d{2})-0?2-(0?[1-9]|1\\d|2[0-8]))|(((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$",message = "用户生日格式错误")
    private String birthday;

    @ApiModelProperty("所在城市")
    @NotEmpty(message = "所在城市不能为空")
    private String city;

    @ApiModelProperty("经度")
    private String longitude;

    @ApiModelProperty("纬度")
    private String latitude;

    @ApiModelProperty("推荐人聊聊号")
    private String referrerChatCode;

    @ApiModelProperty("性别")
    @NotEmpty(message = "性别不能为空")
    @Pattern(regexp = "[1-2]", message = "性别格式错误:1.男 2.女")
    private String sex;

}
